package com.psbc.springbootstudydemo1.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Video {
    private int id;
    private String title;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String summary;
    private int price;
    @JsonProperty("cover_img")
    private String coverImg;
    @JsonFormat(pattern = "yy-MM-dd hh:mm:ss",locale = "zh",timezone = "GMT+8")
    private Date createTime;
    private List<Chapter> chapterList;
    public Video(int id,String title){
        this.id = id;
        this.title = title;
        this.createTime = new Date();
    }
}
